<%@page import="java.util.Calendar"%>
<%@page import="edu.hcmus.sow.utils.StringUtil"%>
<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp" />

<table style="width: 100%; text-align: left; width: 100%; ">
	<tr>
		<td style="width: 10%;"><strong>When</strong></td>
		<td style="width: 8%;"><strong>Time Spent</strong></td>
		<td style="width: 10%;"><strong>Person</strong></td>
		<td style="width: 12%;"><strong>Note</strong></td>
		<td style="width: 8%;"><strong>Project</strong></td>
		<td style="width: 5%;"><strong>Task id</strong></td>
		<td style="width: 10%;"><strong>Task category</strong></td>
		<td style="width: 8%;"><strong>Task title</strong></td>
		<td ><strong>Task description</strong></td>
	</tr>
	<tr><th></th></tr>
	<c:forEach items="${lists}" var="twl" varStatus="i">
			<tr>
				<c:set var="loggedDate" value="${twl.loggedDate}"></c:set>
				<c:set var="timeSpent" value="${twl.timeSpent}"></c:set>
				<td style="width: 10%;"><span><%= StringUtil.convertCalendarToDate((Calendar)pageContext.getAttribute("loggedDate")) %></span></td>
				<td style="width: 8%;"><span><%= StringUtil.convertTimeSpentToString((Integer)pageContext.getAttribute("timeSpent")) %></span></td>
				<td style="width: 10%;"><span>${twl.user.getUsername()}</span></td>
				<td style="width: 12%;"><span>${twl.note }</span></td>
				<td style="width: 8%;"><span>${twl.task.project.getName() }</span></td>
				<td style="width: 5%;"><span>${twl.task.getId() }</span></td>
				<td style="width: 10%;"><span>${twl.task.taskCategory.getName() }</span></td>
				<td style="width: 8%;"><span>${twl.task.getTitle()}</span></td>
				<td ><span>${twl.task.description }</span></td>
				
			</tr>
	</c:forEach>
	<tr><th></th></tr>
	<tr class="total" style="border-top: 2px;">
		<c:set var="total" value="${total}"></c:set>
		<td  colspan="4">Total : <span style="font-weight: bold; font-size: 13px;"><%=StringUtil.convertTimeSpentToString((Integer)pageContext.getAttribute("total")) %> </span> (Hour:Min)</td>
	</tr>
</table>
